﻿using SqlSugar;

namespace MSEAP.Entitys
{
    /// <summary>
    /// 用户信息表
    /// </summary>
    [SugarTable("user", TableDescription = "用户信息表")]
    public class UserEntity
    {
        /// <summary>
        /// 主键ID
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnName = "id", ColumnDescription = "主键ID")]
        public long Id { get; set; }

        /// <summary>
        /// 用户名
        /// </summary>
        [SugarColumn(ColumnName = "username", ColumnDescription = "用户名")]
        public string UserName { get; set; }

        /// <summary>
        /// 真实姓名
        /// </summary>
        [SugarColumn(ColumnName = "realname", ColumnDescription = "真实姓名")]
        public string RealName { get; set; }

        /// <summary>
        /// 性别
        /// </summary>
        [SugarColumn(ColumnName = "sex", ColumnDescription = "性别")]
        public string Sex { get; set; }

        /// <summary>
        /// 权限角色
        /// </summary>
        [SugarColumn(ColumnName = "role", ColumnDescription = "权限角色")]
        public string Role { get; set; }

        /// <summary>
        /// 用户密码
        /// </summary>
        [SugarColumn(ColumnName = "password", ColumnDescription = "用户密码")]
        public string Password { get; set; }

        /// <summary>
        /// 是否是活动数据 1.是 0.否
        /// </summary>
        [SugarColumn(ColumnName = "isactive", ColumnDescription = "是否是活动数据 1.是 0.否")]
        public int IsActive { get; set; } = 1;

        /// <summary>
        /// 创建时间
        /// </summary>
        [SugarColumn(ColumnName = "created", IsOnlyIgnoreUpdate = true)]
        public DateTime Created { get; set; } = DateTime.Now;

        /// <summary>
        /// 更新时间
        /// </summary>        
        [SugarColumn(ColumnName = "updated")]
        public DateTime Updated { get; set; } = DateTime.Now;
    }
}
